// @ts-ignore
/* eslint-disable */
import { request } from 'umi';
import { EmployeeListItem } from '../List/data';
import { AttachedDetailItem } from './data';

export async function attachedList(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<{
    data: EmployeeListItem[];
    /** 列表的内容总数 */
    total?: number;
    success?: boolean;
  }>('/v2/enterprise/employee/attached-list', {
    method: 'GET',
    params: {
      ...params,
      pageNum: params.current,
    },
    ...(options || {}),
  });
}

export async function attachedDetail(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<{
    data: AttachedDetailItem[];
    /** 列表的内容总数 */
    total?: number;
    success?: boolean;
  }>('/v2/enterprise/employee/attached-detail', {
    method: 'GET',
    params: {
      ...params,
      pageNum: params.current,
    },
    ...(options || {}),
  });
}

// /** 新建规则 PUT /api/rule */
// export async function updateRule(data: { [key: string]: any }, options?: { [key: string]: any }) {
//   return request<TableListItem>('/api/rule', {
//     data,
//     method: 'PUT',
//     ...(options || {}),
//   });
// }

// /** 新建规则 POST /api/rule */
// export async function addRule(data: { [key: string]: any }, options?: { [key: string]: any }) {
//   return request<TableListItem>('/api/rule', {
//     data,
//     method: 'POST',
//     ...(options || {}),
//   });
// }

// /** 删除规则 DELETE /api/rule */
// export async function removeRule(data: { key: number[] }, options?: { [key: string]: any }) {
//   return request<Record<string, any>>('/api/rule', {
//     data,
//     method: 'DELETE',
//     ...(options || {}),
//   });
// }
